<extend name='./Public/Base/base.html' />
<block name='script'>
	<link rel="stylesheet" href="__PUBLIC__/Admin/service_list.css"> 
</block>
<block name='content'>

<div class='container-layout'>
	<div class='line margin'>
		<div class='x9'>首页 / 功能管理 / 权限管理</div>
		<div class='x3'>
			<span class='border button button-little bg-blue ' id='AuthGroupAdd'>
				<span class='icon-plus-square-o'></span>
				新增权限分组
			</span>
		</div>
	</div>
	<hr>

	<!--添加服务-->
	<form action='admin_auth_group_add' method='post' name='GroupAdd' class='hidden'>
		<div class='line'>
			<div class='x2 '>
				<lable class='label'>权限分组名：
					<input type='text' class='input' name='AuthTitle' />
				</lable>
			</div>
		</div>
		<div class='line'>
			<div class='x2 '>
				<lable class='label'>排列序号：
					<input type='text' class='input' name='AuthOrder' />
				</lable>
			</div>
		</div>
		<div class='line'>
			<div class='x2 margin-big-top'>
				权限选择
			</div>
		</div>
		<hr>
		<div class='line'>
			<ul style='list-style:none;padding-left:0'>
				<volist name='data_Nav1.list' id='vo'>
					<li>
						<h4 style='font:normal bold 17px normal'>{$vo.nav1_name}</h4>
						<ul style='list-style:none'>
							<volist name='vo.nav2' id='vo2'>
								<li style='float:left;margin:10px'>
									<label>
										<input type='checkbox' name='Rules[]' value='{$vo2.nav2_id}' />
										{$vo2.nav2_name}
									</label>
								</li>
							</volist>
						</ul>
						<div style='clear:both'></div>
					</li>
				</volist>
			</ul>
		</div>
		<div class='line'>
			<div class='x2'>
				<input type='submit' class='button button-block bg-main' value='提交' />
			</div>
		</div>
	</form>


	<table width=100% border=0 class='table'>
		<tr align='center'>
			<th style='width:10%;text-align:center'>用户组名</th>
			<th style='width:65%;text-align:center'>权限列表</th>
			<th style='width:10%;text-align:center'>排列序号</th>
			<th style='width:20%;text-align:center'>操作</th>
		</tr>
		<volist name='data_AuthGroup' id='vo'>
			<tr align='center'  style='text-align:center' >
				<td>{$vo.title}</td>
				<td>
					<volist name='vo.nav2' id='vo2'>
						<span style='float:left;diaplay:block-inline;padding:5px;margin:5px'>{$vo2}</span>
					</volist>
				</td>
				<td>{$vo.orders}</td>
				<td>
					<a href='admin_auth_group_edit?id={$vo.id}&title={$vo.title}&rules={$vo.rules}&orders={$vo.orders}' class='button button-little bg-main'>编辑</a>
					<a gid='{$vo.id}' class='button button-little bg-red Admin_Auth_Group_Del'>删除</a>

				</td>
			</tr>
		</volist>

	</table>

</div>





</block>
<block name='bottom'>
	<script src="__PUBLIC__/Admin/admin_nav1.js"></script> 
	<script>
		$(function(){
			//新增用户分组
			$('#AuthGroupAdd').click(function(){
				$('form[name=GroupAdd]').removeClass('hidden');
			});
			$('.Admin_Auth_Group_Del').click(function(){
				if(!confirm('确认删除?')){
					exit;
				}
				var gid = $(this).attr('gid');
				$.ajax({
					url:'admin_auth_group_del',
					data:{
						gid:gid
					},
					success:function(res){
						if(res > 0){
							alert('删除成功！');
							location.reload(true);
						}else{
							alert('删除失败！');
						}
					}
				});
			});
		})
	</script>
</block>